/* Copyright 2021 Kerim Yalcin
**
**   Licensed under the Apache License, Version 2.0 (the "License");
**   you may not use this file except in compliance with the License.
**   You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
**   Unless required by applicable law or agreed to in writing, software
**   distributed under the License is distributed on an "AS IS" BASIS,
**   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
**   See the License for the specific language governing permissions and
**   limitations under the License.
*/

#ifndef AGX_ERROR_HEADER
#define AGX_ERROR_HEADER

#include <string>
#include <windows.h>

namespace Agx {

class Error {
    private:
        const std::string mClass_Name;
        const std::string mPreMessage_1;
        const std::string mDoubleColon;
        const std::string mColonSpace;

    public:
        Error(const std::string &pClass_Name);

        Error& print_fromWin32(const std::string& pFunction_Name);
        Error& print_fromInterAct(const std::string& pFunction_Name, const std::string& pErrorMessage);
};

}

#endif

/***** Documentation of Error.hpp

const std::string mClass_Name
        Name of the class to be printed out.

Error(const std::string &pClass_Name)
    Parameters:
        pClass_Name
                Name of the class which refers the error.
    
Error& print_fromWin32(const std::string& pFunction_Name)
        Prints out Win32-error-codes.

    Parameters:
        pFunction_Name
                Name of the function which refers the error.
        ex.
            <mClassName = "Class123", pFunctionName = "Function123">
            prints out something like
            
                Error: Agx::Class123::Function123: Access denied

Error& print_fromInterAct(const std::string& pFunction_Name, const std::string& pErrorMessage)
        Prints out error messages related to the InterAct library.

    Parameters:
        pFunction_Name
                Name of the function which refers the error.
        pErrorMessage
                Descriptive error message.
        ex.
            <mClassName = "Class123", pFunctionName = "Function123",
            pErrorMessage = "Object not found."> prints out something like

                Error: Agx::Class123::Function123: Object not found.

End of Documentation *****/